package com.chainyoung.component_tmmarket.mvp.model;

import com.chainyoung.common.bean.UserInfo;
import com.chainyoung.common.di.scope.ActivityScope;
import com.chainyoung.common.integration.IRepositoryManager;
import com.chainyoung.common.mvp.BaseModel;
import com.chainyoung.common.utils.RxUtils;
import com.chainyoung.component_tmmarket.api.MarketService;
import com.chainyoung.component_tmmarket.bean.MarketCoupleList;
import com.chainyoung.component_tmmarket.bean.MarketList;
import com.chainyoung.component_tmmarket.mvp.contract.MarketMainContract;
import com.chainyoung.component_tmmarket.mvp.contract.SearchMarketListContract;

import java.util.TreeMap;

import javax.inject.Inject;

import io.reactivex.Flowable;


@ActivityScope
public class SearchMarketListModel extends BaseModel implements SearchMarketListContract.Model{

    @Inject
    public SearchMarketListModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }




    @Override
    public Flowable<MarketCoupleList> getMarketCoupleList(TreeMap<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(MarketService.class)
                .getMarketCoupleList(map)
                .compose(RxUtils.<MarketCoupleList>handleResult());
    }
}

